package com.gexiaobao.pigeon.ui.adapter

import androidx.appcompat.widget.AppCompatImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.model.bean.OrgListResponse
import com.gexiaobao.pigeon.app.util.ImageLoaderManager

/**
 * created by : hxw
 * @date : 20221115
 * Describe :
 */
class OrganizationAdapter(data: ArrayList<OrgListResponse>) :
    BaseQuickAdapter<OrgListResponse, BaseViewHolder>(R.layout.item_organization, data) {

    override fun convert(holder: BaseViewHolder, item: OrgListResponse) {
        holder.setText(R.id.tv_item_org_name, item.name)
        holder.setText(R.id.organize_association_org_des, item.desc)
        holder.setText(R.id.tv_item_organization_vip, item.memberNum.toString())
        holder.setText(R.id.tv_item_organization_follow, item.followNum.toString())
        holder.setText(R.id.organize_association_address, item.detailAddr)

        val orgIcon = holder.getView<AppCompatImageView>(R.id.ivOrgIcon)
        ImageLoaderManager.loadCircleImageFall(context, item.icon, orgIcon, R.mipmap.profilepic_str_1)

    }
}